﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Entity;

public partial class Controls_MenuTop : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string str = "";
            if (Session["loginClient"] == null)
            {
                str += "<div class=\"top-box\">";
                str += "<a class=\"current reg\" href=\"#\" style=\" color:#FF6633\" onclick=\"window.location='../Pages/Register.aspx';\">Register</a>";
                str += "</div>";
                str += "<div class=\"top-box\" id=\"login\">";
                str += "<a class=\"login pop\" rel=\"0\" alt=\"#login\" href=\"#\" onclick=\"window.location='../Pages/Login.aspx';\" id=\"loginLink\" style=\"outline:none\">Login</a>";
                str += "</div>";
                str += "</div>";
            }
            else
            {
                Customer cus=(Customer)Session["loginClient"];
                str += "<div class=\"top-box\">";
                str += "<a class=\"current reg\" href=\"#\" style=\" color:#FF6633\" onclick=\"window.location='../Pages/Logout.aspx';\">Logout</a>";
                str += "</div>";
                str += "<div class=\"top-box\" id=\"login\">";
                str += "<a class=\"login pop\" rel=\"0\" alt=\"#login\" href=\"#\" id=\"loginLink\" style=\"outline:none;\">Welcome: "+cus.Username+"</a>";
                str += "</div>";
                str += "</div>";
            }
            lblShow.Text = str;
        }
    }
}
